﻿@{
    ViewBag.Title = "IBank Client Room";
    Layout = "~/Views/Home/_HomeLayout.cshtml";
}
@model ClientApp.Models.QuickPayments
<div class="page">
    <div class="commonOperations">
        <div class="commonOperation">
            <p>
                My Cards</p>
            <a class="operation" href="/cards">
                <img src="@Url.Content("~/Content/images/credit-cards.jpg")" />
            </a>
        </div>
        <div class="commonOperation">
            <p>
                Money Transfers</p>
            <a class="operation" href="/transfers">
                <img src="@Url.Content("~/Content/images/transfers.jpg")" />
            </a>
        </div>
        <div class="commonOperation">
            <p>
                Payments</p>
            <a class="operation" href="/payments">
                <img src="@Url.Content("~/Content/images/payments.jpg")" />
            </a>
        </div>
        <div class="commonOperation">
            <p>
                AutoPayments</p>
            <a class="operation" href="/autopayments">
                <img src="@Url.Content("~/Content/images/payments.jpg")" />
            </a>
        </div>
    </div>
    <h2>
        Quick Board</h2>
    <div class="quickOperations">
        @for (int i = 0; i < Model.Count; i++)
        {
            var qPayment = Model[i];
            <div class="quickOperation">
                <p>@qPayment.Name</p>
                <form id="pay_form_@(i)" action="/Payments/Detail" method="post">
                <input type="hidden" name="paymentId" value="@qPayment.PaymentId"/>
                <input type="hidden" name="cardNumber" value="@qPayment.CardNumber" />
                <input type="hidden" name="paymentDetail" value="@qPayment.PaymentDetail.Replace("\\", "\\\\")"  />
                </form>
                <a class="operation" href="#" onclick="$('#pay_form_@(i)').submit(); return false;">
                    <img src="@Url.Content("~/Content/images/payments.jpg")" />
                </a><a  class="operation" href="/Payments/DeleteQuickPayment?index=@i">Delete</a>
            </div>

        }
    </div>
</div>
